import request from '@/utils/request';
import type { ChatFlowType, ChatFlowListParams } from './data.d';



// 查询流程列表
export async function getChatFlowList(params?: ChatFlowListParams) {
  const queryString = new URLSearchParams(params).toString();
  return request(`/api/chat/chatFlow/list?${queryString}`, {
    data: params,
    method: 'GET',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8',
    },
  });
}


// 查询流程详细
export function getChatFlow(flowId: string) {
  return request(`/api/chat/chatFlow/${flowId}`, {
    method: 'GET',
  });
}

// 新增流程
export async function addChatFlow(params) {
  return request('/api/chat/chatFlow', {
    method: 'POST',
    data: params,
  });
}

// 修改流程
export async function updateChatFlow(params) {
  return request('/api/chat/chatFlow', {
    method: 'PUT',
    data: params,
  });
}

// 删除流程
export async function removeChatFlow(ids: string) {
  return request(`/api/chat/chatFlow/${ids}`, {
    method: 'DELETE',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8',
    },
  });
}
